home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
UNIXTOOL
/
GNU
/
TILEFORTH
/
TILE
/
TILE~
/
!Tile
/
test
/
enumerates
< prev
next >
Wrap
Text File
|
1992-04-19
|
693b
|
36 lines
.( Loading Enumerates test...) cr
#include <tile$lib>.enumerates
enumerates
.( 1: Define a set of small numbers as enumerates and check their values) cr
enum.type SMALL-NUMBERS ( -- )
enum ZERO ( -- enum)
enum ONE ( -- enum)
enum TWO ( -- enum)
enum THREE ( -- enum)
enum FOUR ( -- enum)
enum FIVE ( -- enum)
enum.end
ZERO . ONE . TWO . THREE . FOUR . FIVE . cr
5 >enum SMALL-NUMBERS .name cr
.( 2: Define a set of operation code and give the values for each enumerate) cr
enum.type OP-CODES ( -- )
enum LOAD ( -- enum)
enum STORE ( -- enum)
enum ADD ( -- enum)
enum SUB ( -- enum)
enum MUL ( -- enum)
enum.end
LOAD . STORE . ADD . SUB . MUL . cr
forth only